package com.itcast.cn.myhashset;

import java.util.HashMap;
import java.util.Set;
import java.util.TreeMap;

/**
 * @PackageName: com.itcast.cn.myhashset
 * @ClassName: Map04
 * @Author: wusong
 * @Date: 2020/7/7 0007 11:23
 * @Description:
 */
public class Map04 {
    public static void main(String[] args) {
        TreeMap<Student, String> tm = new TreeMap<>();
        Student s1 = new Student("大黑", 22);
        Student s2 = new Student("天才", 25);
        Student s3 = new Student("菜鸡", 26);
        tm.put(s1, "中国");
        tm.put(s2, "陕西");
        tm.put(s3, "西安");
        final Set<Student> keySet = tm.keySet();
        tm.forEach(
                (Student key, String value) -> {
                    System.out.println(key + " " + value);
                }
        );
    }
}

